Skip to content

Management command to create experiments/alternatives#180

Open
millar wants to merge 1 commit intomasterfrom
sm-management-command
Open

Management command to create experiments/alternatives#180
millar wants to merge 1 commit intomasterfrom
sm-management-command

Conversation

@millar
Copy link
Copy Markdown
Contributor

@millar millar commented Apr 17, 2018

No description provided.

return

for alternative in options['alternatives']:
if ':' in alternative:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better we include the : syntax in help message for parser?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

Copy link
Copy Markdown
Contributor

@lisongx lisongx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm for other parts

try:
experiment = Experiment.objects.create(name=options['name'])
except IntegrityError:
self.stdout.write(self.style.ERROR("An experiment named '%s' already exists" % options['name']))
Copy link
Copy Markdown

@JonathanUsername JonathanUsername Jun 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.stderr is convention for errors surely

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise CommandError("Wibble failure")

Just checked docs and this might be the recommended practice

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants